package org.git.movie.controller;

import org.git.movie.annotations.Verify;
import org.git.movie.form.ProShopForm;
import org.git.movie.service.IProShopService;
import org.git.movie.util.BaseController;
import org.git.movie.util.BaseResponse;
import org.git.movie.vo.FfVodListDto;
import org.git.movie.vo.PageDto;
import org.git.movie.vo.ProShopVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author sqyc
 */
@RestController
@RequestMapping("")
public class ProShopController extends BaseController {

    @Autowired
    private IProShopService iProShopService;

    @PostMapping("/proshop/dosearch.do")
    public BaseResponse<PageDto<ProShopVo>> dosearch(
            @Verify(param="pageNo",rule="required|min(1)") int pageNo,
            @Verify(param="pageSize",rule="required|min(3)|max(60)") int pageSize,
            @Verify(param="fromSite",rule="required|enableValueWithEmpty(jd_pro,jd_huodong,taobao_nvzhuang,taobao_nvbao,taobao_nvxie)") String fromSite,
            ProShopForm proShopForm
    ){

        PageDto<ProShopVo> pages =  iProShopService.findProShopVoPage(proShopForm,pageNo,pageSize);
        return   ok(pages);

    }
}
